//
//  BIDInfoBriefViewController.m
//  JuanChengOA
//
//  Created by mal on 2017/7/19.
//  Copyright © 2017年 mal. All rights reserved.
//

#import "BIDInfoBriefViewController.h"
#import "BIDInfoBriefListViewController.h"
#import "BIDConstructionListViewController.h"

@interface BIDInfoBriefViewController ()

@end

@implementation BIDInfoBriefViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"信息简报";
//    _menuArr = @[@{@"title":@"昨日要情", @"imgName":@"zuoriyaoqing.png", @"listURL":@"townAndroid!gainYesterList.action", @"detailURL":@"townAndroid!detailYesterWork.action"},
//                 @{@"title":@"网络舆情", @"imgName":@"wangluoyuqing.png", @"listURL":@"townAndroid!gainInternetInfoList.action", @"detailURL":@"townAndroid!detailInternetInfo.action"},
//                 @{@"title":@"城市建设", @"imgName":@"chengshijianshe.png", @"listURL":@"townAndroid!gainFocusPoolList.action", @"detailURL":@"townAndroid!detailFocusPool.action"},
//                 @{@"title":@"招商引资", @"imgName":@"zhaoshangyinzi.png", @"listURL":@"townAndroid!gainBeautifulCountryList.action", @"detailURL":@"townAndroid!detailBeautifulCountry.action"},
//                 @{@"title":@"领导工作动态", @"imgName":@"gongzuodongtai.png", @"listURL":@"townAndroid!gainGovDynamicsList.action", @"detailURL":@"townAndroid!detailGovDynamics.action"},
//                 @{@"title":@"维稳信访", @"imgName":@"weiwenxinfang.png", @"listURL":@"townAndroid!gainTownWorkList.action", @"detailURL":@"townAndroid!detailTownWork.action"},
//                 @{@"title":@"其他信息简报", @"imgName":@"qita.png", @"listURL":@"townAndroid!gainLetterInfoList.action", @"detailURL":@"townAndroid!detailLetterInfo.action"},
//                 @{@"title":@"大项目建设", @"imgName":@"daxiangmujianshe.png", @"listURL":@"", @"detailURL":@""},
//                 @{@"title":@"精准扶贫", @"imgName":@"jingzhunfupin.png", @"listURL":@"townAndroid!gainPoolDataList.action", @"detailURL":@"townAndroid!detailPoolData.action"}];
    _menuArr = @[@{@"title":@"昨日要情", @"imgName":@"zuoriyaoqing.png", @"type":@"0"},
                 @{@"title":@"网络舆情", @"imgName":@"wangluoyuqing.png", @"type":@"1"},
                 @{@"title":@"城市建设", @"imgName":@"chengshijianshe.png", @"type":@"3"},
                 @{@"title":@"招商引资", @"imgName":@"zhaoshangyinzi.png", @"type":@"4"},
                 @{@"title":@"领导工作动态", @"imgName":@"gongzuodongtai.png", @"type":@"5"},
                 @{@"title":@"其他信息简报", @"imgName":@"qita.png", @"type":@"6"},
                 @{@"title":@"美丽乡村", @"imgName":@"beautyTown.png", @"type":@"8"},
                 @{@"title":@"党建新闻", @"imgName":@"dangjianNews.png", @"type":@"2"},
                 @{@"title":@"十九大学习", @"imgName":@"nineteenMeetingStudy.png", @"type":@"9"}
                 ];
}
    
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
    
- (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
        [self refreshBadge];
    }
    
- (void)pushNotificationHandler
    {
        //[self refreshBadge];
    }
    
    //刷新角标
- (void)refreshBadge
{
    NSString *strPost = [[NSString alloc] initWithFormat:@"userId=%@", [AppDelegate getUserId]];
    NSDictionary *dictionary1 = @{@"index":@7, @"url":@"itemBuildingAndroid!gainNotRead.action", @"param_request":strPost, @"param_response":@"notRead"};    
    NSArray *arr = [[NSArray alloc] initWithObjects:dictionary1, nil];
//    [self getCornerMarkCount:arr];
}
    
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
    {
        UIViewController *vc = nil;
        NSUInteger row = [indexPath row];
        NSDictionary *dic = _menuArr[row];
        NSString *strURL = dic[@"type"];
        if(strURL.length==0)
        {
            BIDConstructionListViewController *vc = [[BIDConstructionListViewController alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
        else
        {
            BIDInfoBriefListViewController *listVC = [[BIDInfoBriefListViewController alloc] init];
            listVC.title = dic[@"title"];
            listVC.type = dic[@"type"];
            vc = listVC;
            [self.navigationController pushViewController:vc animated:YES];
        }
    }

@end
